﻿using System;
using System.IO;
using Microsoft.Extensions.Configuration;

namespace Sprout.Configuration.Yaml
{
    internal class YamlConfigurationProvider : FileConfigurationProvider
    {
        public YamlConfigurationProvider(FileConfigurationSource source) : base(source)
        {
        }

        public override void Load(Stream stream)
        {
            try
            {
                var parser = new YamlConfigurationFileParser();
                Data = parser.Parse(stream);
            }
            catch(Exception ex)
            {
                throw ex;
            }
        }
    }
}
